/*
-------------------------------------------------------------------
BIE is Copyright 2001-2004 Brunswick Corp.
-------------------------------------------------------------------
Please read the legal notices (docs/legal.txt) and the license
(docs/bie_license.txt) that came with this distribution before using
this software.
-------------------------------------------------------------------

*/
/*
 * Access.java
 *
 * Created on January 16, 2003, 9:19 AM
 */

package com.webdeninteractive.bie.dashboard;

import javax.servlet.*;
import javax.servlet.http.*;

/**
 *
 * @author  jdepons
 * @version
 */
public class Access2 extends HttpServlet {
    
    /** Initializes the servlet.
     */
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        
    }
    
    /** Destroys the servlet.
     */
    public void destroy() {
        
    }
    
    /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
     * @param request servlet request
     * @param response servlet response
     */
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
        
        RequestDispatcher dispatcher = null;
                        
//        if (request.getServletPath().indexOf("login.bie") != -1) {            
//            dispatcher = getServletContext().getRequestDispatcher("/login.jsp");
//        }else {            
            String path = request.getServletPath().replaceAll("\\.bie",".jsp");                        
            dispatcher = getServletContext().getRequestDispatcher("/view/dashboard.jsp");
            request.setAttribute("includeFile",path);            
//        }
                
        dispatcher.forward(request, response);    
    
    }
    
    /** Handles the HTTP <code>GET</code> method.
     * @param request servlet request
     * @param response servlet response
     */
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
        processRequest(request, response);
    }
    
    /** Handles the HTTP <code>POST</code> method.
     * @param request servlet request
     * @param response servlet response
     */
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
        processRequest(request, response);
    }
    
    /** Returns a short description of the servlet.
     */
    public String getServletInfo() {
        return "Short description";
    }
    
}
